import axios from '@/utils/http'

//接口列表
//-----------供应商管理

//获取
export const getallSupplier='/providerManagement/providerManagement/findProviderList'
//添加
export const addProvider='/providerManagement/providerManagement/addProvider'
//删除
export const deleteSupplier='/providerManagement/providerManagement/deleteProviderById'
//编辑
export const updateProvider='/providerManagement/providerManagement/updateProviderById'
//转交
export const transferApi='/providerManagement/providerManagement/updateUserIdByIds'
export const getDepApi=''
export const getStaffByDep=''

//高级搜索
//调取部门信息
export const depList='/userManagement/deptManagement/findDeptList1'
//部门信息回显
export const depPerson='/userManagement/user/findUserByDepId'
//查找
export const findAdvancedApi='/providerManagement/providerManagement/advanceSearchProvider'

//普通查询
export const findApi='/providerManagement/providerManagement/findProvider'


//-----------供应商跟进
export const getallFollow='/providerManagement/follow/findFollowList'
//添加
export const addFollowApi='/providerManagement/follow/addFollow'
//查询
export const findFollow='/providerManagement/follow/findFollowListByName'
//编辑
export const updateFollow='/providerManagement/follow/updateFollowById'
//删除
export const deleteFollow='/providerManagement/follow/deleteFollowById'
//封装网络请求方法

const supply={
//-----------供应商管理    
getAllSupplierList(params){
    console.log(params);
    return axios.get(getallSupplier,{params})
},
addSupplier(params){
    console.log(params);
    return axios.post(addProvider,params)
},
deleteSupplierById(params){
    console.log(params);
    return axios.post(deleteSupplier+"?id="+params)
},
updateSupplier(params){
    return axios.post(updateProvider,params)
},
transfer(params){
    console.log(params);
    return axios.post(transferApi,params)
},

getDepList(){
    return axios.get(depList)
},
getDepPerson(params){
    return axios.post(depPerson+"?depId="+params)
},
findAdvanced(params){
    return axios.post(findAdvancedApi,params)
}, 
findSupplier(currentPage,pageSize,con){
    return axios.post(findApi+"?currentPage="+currentPage+"&pageSize="+pageSize+"&findProviderCondition="+con)
},

//-----------供应商跟进
getFollowList(params){
    return axios.get(getallFollow,{params})
},
addFollow(params){
    return axios.post(addFollowApi,params)
},
searchFollow(cur,size,name){
    return axios.post(findFollow+"?currentPage="+cur+"&pageSize="+size+"&name="+name)
},
editFollow(params){
    return axios.post(updateFollow,params)
},
deleteFollowById(params){
    return axios.post(deleteFollow+"?id="+params)
},
} 




//导出
export default supply;
